<span id="${uuid}"></span>
<table style="table-layout: fixed;width: 100%">
    <tr style="word-wrap:break-word;line-height: 50px;height: 50px">
        <td><h2>名称：${document.docName}</h2></td>
        <c:if test="${versionTotal > 1}">
            <td style="text-align: left">正在使用的版本：
                <c:choose>
                    <c:when test="${copy.docNow.docStatus eq 'DOC_STATUS_PUBLISHED'}">V${copy.docNow.version}</c:when>
                    <c:otherwise>
                        <c:choose>
                            <c:when test="${copy.docNow.version eq 0}">无</c:when>
                            <c:otherwise>V${copy.docNow.version-1}</c:otherwise>
                        </c:choose>
                    </c:otherwise>
                </c:choose>
            </td>
        </c:if>
        <c:if test="${versionTotal > 1}">
            <c:if test="${loginUser.id eq document.createUser.id or (param['admin'] eq 1)}">
                <td style="text-align: left">选择版本：<select data-id="version" style="width: 100px;height: 30px">
                    <c:forEach items="${versions}" var="version">
                        <option value="${version.id}"
                                <c:if test="${copy.docNow.version eq version.version}">selected</c:if>
                                >${version.versionDescription}</option>
                    </c:forEach>
                </select></td>
            </c:if>
        </c:if>
    </tr>
</table>
<table class="hydra-table" style="display: inline-block;width: 40%">
    <tr class="hydra-tr-bg">
        <td class="hydra-left">文档类型：</td>
        <td class="hydra-right1">${document.moduleType.dirValue}</td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">关键字：</td>
        <td class="hydra-right1">${document.docKeyWord}</td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">创建人：</td>
        <td class="hydra-right1">${document.createUser.userName}</td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">修改人：</td>
        <td class="hydra-right1">
            ${document.updateUser eq null ? '无' : document.updateUser.userName}
        </td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">下载次数：</td>
        <td class="hydra-right1">${document.downloadTimes}</td>
    </tr>
</table>
<table class="hydra-table" style="display: inline-block;width: 40%">
    <tr class="hydra-tr-bg">
        <td class="hydra-left">所属部门：</td>
        <td class="hydra-right1">${document.docBelong.orgName}</td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">状态：</td>
        <td class="hydra-right1">${document.docStatus eq "DOC_STATUS_PUBLISHED" ? "已发布" : "未发布"}</td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">创建时间：</td>
        <td class="hydra-right1">
            <fmt:formatDate value="${document.createTime}" pattern="yyyy-MM-dd"></fmt:formatDate>
        </td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">修改时间：</td>
        <td class="hydra-right1">
            <c:if test="${document.updateTime eq null}">无</c:if>
            <fmt:formatDate value="${document.updateTime}" pattern="yyyy-MM-dd"></fmt:formatDate>
        </td>
    </tr>
    <tr class="hydra-tr-bg">
        <td class="hydra-left">附件：</td>
        <td class="hydra-right1">
            <a href="${pageContext.request.contextPath}/app/api/document/download?id=${document.id}">
                ${document.attachmentName}
            </a>
        </td>
    </tr>
</table>
<table style="table-layout: fixed;width: 80%;margin-top: -5px">
    <tr style="word-wrap:break-word;line-height: 50px;height: 50px">
        <td style="width: 90px;text-align: right">摘要：</td>
        <td style="padding-left: 10px">${document.docDescription}</td>
    </tr>
</table>
<%--使用jstl判断类型--%>
<c:choose>
    <c:when test="${type eq 'OFFICE'}">
        <c:choose>
            <c:when test="${document.fileConvert.status eq 'FILE_CONVERT_STATUS_SUCCESS'}">
                <div id="flash_viewer" style="height: 600px;"></div>
            </c:when>
            <c:when test="${document.fileConvert.status eq 'FILE_CONVERT_STATUS_FAILURE'}">
                <div style="height: 600px;">
                    <p>
                        文件转换失败，请联系作者或管理员重新上传文档
                    </p>
                </div>
            </c:when>
            <c:otherwise>
                <div style="height: 600px;">
                    <p>
                        文件转换正在转换中
                    </p>
                </div>
            </c:otherwise>
        </c:choose>
    </c:when>
    <c:when test="${type eq 'MEDIA'}">
        <div style="text-align: center">
            <div id="jp_container_1" class="jp-video jp-video-360p" role="application" aria-label="media player">
                <div class="jp-type-single">
                    <div id="jquery_jplayer_1" class="jp-jplayer"></div>
                    <div class="jp-gui">
                        <div class="jp-video-play">
                            <button class="jp-video-play-icon" role="button" tabindex="0">play</button>
                        </div>
                        <div class="jp-interface">
                            <div class="jp-progress">
                                <div class="jp-seek-bar">
                                    <div class="jp-play-bar"></div>
                                </div>
                            </div>
                            <div class="jp-current-time" role="timer" aria-label="time">&nbsp;</div>
                            <div class="jp-duration" role="timer" aria-label="duration">&nbsp;</div>
                            <div class="jp-controls-holder">
                                <div class="jp-controls">
                                    <button class="jp-play" role="button" tabindex="0">play</button>
                                    <button class="jp-stop" role="button" tabindex="0">stop</button>
                                </div>
                                <div class="jp-volume-controls">
                                    <button class="jp-mute" role="button" tabindex="0">mute</button>
                                    <button class="jp-volume-max" role="button" tabindex="0">max volume</button>
                                    <div class="jp-volume-bar">
                                        <div class="jp-volume-bar-value"></div>
                                    </div>
                                </div>
                                <div class="jp-toggles">
                                    <button class="jp-repeat" role="button" tabindex="0">repeat</button>
                                    <button class="jp-full-screen" role="button" tabindex="0">full screen</button>
                                </div>
                            </div>
                            <div class="jp-details">
                                <div class="jp-title" aria-label="title">&nbsp;</div>
                            </div>
                        </div>
                    </div>
                    <div class="jp-no-solution">
                        <span>Update Required</span>
                        To play the media you will need to either update your browser to a recent version or update your
                        <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
                    </div>
                </div>
            </div>
        </div>
    </c:when>
    <c:when test="${type eq 'IMAGE'}">
        <div style="text-align: left">
            <img src="${pageContext.request.contextPath}/print/${document.attachment}" style="max-width: 100%"/>
        </div>
    </c:when>
    <c:otherwise>
        <div style="height: 600px;">
            <p>
                该类型的文件不支持在线预览
            </p>
        </div>
    </c:otherwise>
</c:choose>